package com.jiangyao.controller;


import com.jiangyao.common.ApiResult;
import com.jiangyao.model.entity.Role;
import com.jiangyao.service.RoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 角色 前端控制器
 * </p>
 *
 * @author yangyongchuan
 * @since 2020-08-12
 */
@RestController
@RequestMapping("/role")
@Api(tags = "系统管理-后台管理用户")
public class RoleController extends BaseController {

	@Autowired
	private RoleService roleService;

	/**
	 * 获取全部角色列表
	 *
	 * @return 结果
	 */
	@ApiOperation(value = "获取全部角色列表")
	@PostMapping("/list")
	public ApiResult<Role> getListPage() {
		return ApiResult.success(roleService.getValidList());
	}
}

